home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / e / amigae21b.lha / Amiga_E_v2.1b / Sources / Examples / Public.e < prev    next >
Text File  |  1992-09-02  |  1KB  |  39 lines

  1. /* Opening our public screen with a shell on it ... 
  2.    note: this example does not handle two screens with the
  3.          same name, nor other fancy things...                   */
  4.  
  5. OPT OSVERSION=37
  6.  
  7. MODULE 'intuition/screens'
  8.  
  9. ENUM OKAY,NOSCREEN,NOSIG
  10.  
  11. PROC main() HANDLE
  12.   DEF s=NIL,sig=-1,name
  13.   IF (s:=OpenScreenTagList(0,          /* get ourselves a public screen */
  14.          [SA_DEPTH,2,
  15.           SA_DISPLAYID,$8000,
  16.           SA_PUBNAME,name:='PublicShell',
  17.           SA_TITLE,name,
  18.           SA_PUBSIG,IF (sig:=AllocSignal(-1))=NIL THEN Raise(NOSIG) ELSE sig,
  19.           SA_PUBTASK,NIL,
  20.           0,0]))=NIL THEN Raise(NOSCREEN)
  21.   PubScreenStatus(s,0)                 /* make it available */
  22.   SetDefaultPubScreen(name)
  23.   SetPubScreenModes(SHANGHAI)
  24.   Execute('NewShell WINDOW CON:0/0/640/256/bla/NOBORDER/BACKDROP',NIL,NIL)
  25.     /* other applications can use our screen also.
  26.        if we just want our shell on it, turn it private again */
  27.   Wait(Shl(1,sig))            /* wait until all windows closed */
  28.   SetDefaultPubScreen(NIL)    /* workbench is default again */
  29.   Raise(OKAY)
  30. EXCEPT
  31.   IF s THEN CloseS(s)
  32.   IF sig>=0 THEN FreeSignal(sig)
  33.   IF exception=NOSCREEN
  34.     WriteF('Could not open screen!\n')
  35.   ELSEIF exception=NOSIG
  36.     WriteF('No signal available!\n')
  37.   ENDIF
  38. ENDPROC
  39.